package com.baor.controller;

import com.baor.domain.ClassVo;
import com.baor.domain.StuVo;
import com.baor.service.impl.ClazzServiceImpl;
import com.baor.utils.AjaxResult;
import org.apache.ibatis.annotations.Param;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RequestMapping("clazz")
@RestController
public class ClazzController {
    @Autowired
    private ClazzServiceImpl clazzService;

    @RequestMapping("/clazzList")
    public AjaxResult<?> clazzList(@RequestBody Map<String,Object> params) {
        return clazzService.clazzList(params);
    }
    @RequestMapping("/deleteClazz")
    public AjaxResult<?> deleteClazz(int id){
        return clazzService.deleteClazz(id);
    }
    @RequestMapping("/updateClazz")
    public AjaxResult<?> updateClazz(@RequestBody ClassVo classVo){
        return clazzService.updateClazz(classVo);
    }
    @RequestMapping("/addClazz")
    public AjaxResult<?> addClazz(@RequestBody ClassVo classVo){
        return clazzService.addClazz(classVo);
    }
    @RequestMapping("/teacherList")
    public AjaxResult<?> teacherList(){
        return clazzService.teacherList();
    }
    @RequestMapping("/clazzStu")
    public AjaxResult<?> clazzStu(@RequestBody Map<String,Object> params){
        return clazzService.clazzStu(params);
    }
    @RequestMapping("/stuDetail")
    public AjaxResult<?> stuDetail(int stuId){
        return clazzService.stuDetail(stuId);
    }
    @RequestMapping("/deleteStu")
    public AjaxResult<?> deleteStu(int stuId){
        return clazzService.deleteStu(stuId);
    }
    @RequestMapping("/updateBatchById")
    public AjaxResult<?> updateBatchById(@RequestBody Map<String,Object> params){
        return clazzService.updateBatchById(params);
    }
    @RequestMapping("/classSelect")
    public AjaxResult<?> classSelect(){
        return clazzService.classSelect();
    }
    @RequestMapping("/addSubject")
    public AjaxResult<?> addSubject(@RequestBody Map<String,Object> params){
        return clazzService.addSubject(params);
    }
    @RequestMapping("/selectSub")
    public AjaxResult<?> selectSub(@RequestBody  Map<String,Object> params){
        return clazzService.selectSub(params);
    }
}